package com.wkbb.basic.service.impl;

import com.wkbb.basic.mapper.*;
import com.wkbb.basic.model.*;
import com.wkbb.basic.service.UserInfoService;
import com.wkbb.common.base.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class UserInfoServiceImpl extends BaseServiceImpl<UserInfo> implements UserInfoService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Autowired
    public void setMapper(UserInfoMapper mapper) {
        super.setMapper(mapper);
    }

    @Override
    public void update(UserInfo userInfo, boolean isBack) throws Exception {
        if (isBack){
            userInfoMapper.updateBack(userInfo);
        }else {
            update(userInfo);
        }
    }
}
